{# Copyright The IETF Trust 2015, All Rights Reserved #}
{% load origin %}
{% origin %}
 <!-- [html-validate-disable-block input-missing-label -- labelled via aria-label] -->
{% for rfc,choice_slug in form.relations.items %}
    <div class="input-group mb-3">
        <select class="form-control select2-field"
                data-select2-ajax-url="{% url 'ietf.doc.views_search.ajax_select2_search_docs' model_name='document' doc_type='rfc' %}"
                data-max-entries="1"
                data-width="resolve"
                data-result-key="text"
                name="new_relation_row_{{ rfc }}"
                id="new_relation_row_{{ rfc }}"
                aria-label="Enter new affected RFC"
                data-placeholder="Enter new affected RFC.">
            <option id="{{ rfc|upper }}" selected>
                {{ rfc|upper }}
            </option>
        </select>
        <select class="form-select"
                aria-label="Select proposed new status"
                name="statchg_relation_row_{{ rfc }}"
                id="statchg_relation_row_{{ rfc }}">
            <option {% if choice_slug == "" %}selected{% endif %}>
                (None)
            </option>
            {% for rel in relation_slugs %}
                <option value="{{ rel.slug }}"
                        {% if choice_slug == rel.slug %}selected{% endif %}>
                    {{ rel.name }}
                </option>
            {% endfor %}
        </select>
        <button type="button" class="btn btn-danger delete">Delete</button>
    </div>
{% endfor %}
<div class="input-group mb-3 new-relation-row">
    <select name="new_relation_row_"
            id="new_relation_row_rfc"
            aria-label="Enter new affected RFC"
            class="form-control select2-field"
            data-select2-ajax-url="{% url 'ietf.doc.views_search.ajax_select2_search_docs' model_name='document' doc_type='rfc' %}"
            data-result-key="text"
            data-max-entries="1"
            data-width="resolve"
            data-placeholder="Enter new affected RFC.">
    </select>
    <select id="statchg_relation_row"
            class="form-select"
            aria-label="Select proposed new status"
            name="statchg_relation_row_">
        <option {% if choice_slug == "" %}selected{% endif %}>
            (Select proposed new status.)
        </option>
        {% for rel in relation_slugs %}
            <option value="{{ rel.slug }}"
                    {% if choice_slug == rel.slug %}selected{% endif %}>
                {{ rel.name }}
            </option>
        {% endfor %}
    </select>
    <button type="button" class="btn btn-outline-danger delete" disabled>Delete</button>
</div>